{extend name="shop/showstore/common/store_layout" /}
{block name="content"}

<?php 
//加载店铺装修静态页
if(isset($decoration_file)) { 
    require($decoration_file);
} 
?>
<?php if(!$store_decoration_only) {?>
<div class="wrapper" style="width:100%; margin:0 auto; text-align:center">
<div class="flexslider">
      <ul class="slides">
        <?php if(!empty($store_slide) && is_array($store_slide)){?>
        <?php for($i=0;$i<5;$i++){?>
        <?php if($store_slide[$i] != ''){?>
        <li><a style="background: url('__UPLOAD_PATH__/shop/store/slide/{$store_slide[$i]}') no-repeat center center;" <?php if($store_slide_url[$i] != '' && $store_slide_url[$i] != 'http://'){?>href="<?php echo $store_slide_url[$i];?>"<?php }?>></a></li>
        <?php }?>
        <?php }?>
        <?php }else{?>        
        <li><a style="background:url('__UPLOAD_PATH__/shop/store/slide/f01.jpg') no-repeat center center;" href="javascript:;"></a></li>
        <li><a style="background: url('__UPLOAD_PATH__/shop/store/slide/f02.jpg') no-repeat center center;" href="javascript:;"></a></li>
        <li><a style="background: url('__UPLOAD_PATH__/shop/store/slide/f03.jpg') no-repeat center center;" href="javascript:;"></a></li>
        <li><a style="background: url('__UPLOAD_PATH__/shop/store/slide/f04.jpg') no-repeat center center;" href="javascript:;"></a></li>
        <?php }?>
      </ul>
    </div>
  </div>  
<div class="wrapper mt10">
  <div class="ncs-main">
    <div class="ncs-main-container">
      <div class="title"> <span><a href="<?php echo url('shop/Showstore/goods_all', array('store_id' => I('param.store_id')));?>" class="more">更多</a></span>
        <h4>推荐商品</h4>
      </div>
      <div class="content ncs-goods-list">
        <?php if(!empty($recommended_goods_list) && is_array($recommended_goods_list)){?>
        <ul>
          <?php foreach($recommended_goods_list as $value){?>
          <li>
            <dl>
              <dt><a href="<?php echo url('shop/Goods/index', array('goods_id'=>$value['goods_id']));?>" class="goods-thumb" target="_blank">
              	<img src="__UPLOAD_PATH__/shop/common/loading.gif" rel="lazy" data-url="<?php echo thumb($value, 240);?>" alt="<?php echo $value['goods_name'];?>"/></a>
                <ul class="goods-thumb-scroll-show">
                <?php if (is_array($value['image'])) { array_splice($value['image'], 5); ?>
                  <?php $i=0;foreach ($value['image'] as $val) { $i++; ?>
                  <li<?php if($i==1) {?> class="selected"<?php }?>><a href="javascript:void(0);">
                  	<img src="__UPLOAD_PATH__/shop/common/loading.gif" rel="lazy" data-url="<?php echo thumb($val, 60);?>"/></a></li>
                  <?php }?>
                <?php } else {?>
                  <li class="selected"><a href="javascript:void(0)">
                  	<img src="__UPLOAD_PATH__/shop/common/loading.gif" rel="lazy" data-url="<?php echo thumb($value, 60);?>"></a></li>
                <?php }?>
                </ul>
              </dt>
              <dd class="goods-name"><a href="<?php echo url('shop/Goods/index', array('goods_id'=>$value['goods_id']));?>" title="<?php echo $value['goods_name'];?>" target="_blank"><?php echo $value['goods_name']?></a></dd>
              <dd class="goods-info"><span class="price"><i>￥</i> <?php echo ncPriceFormat($value['goods_promotion_price']);?> </span> <span class="goods-sold">已售：<strong><?php echo $value['goods_salenum'];?></strong> 件</span></dd>
              <?php if (sysconf('groupbuy_allow') && $value['goods_promotion_type'] == 1) {?>
              <dd class="goods-promotion"><span>抢购商品</span></dd>
              <?php } elseif (sysconf('promotion_allow') && $value['goods_promotion_type'] == 2)  {?>
              <dd class="goods-promotion"><span>限时折扣</span></dd>
              <?php }?>
              </dl>
          </li>
          <?php }?>
        </ul>
        <?php }else{?>
        <div class="nothing">
          <p>很抱歉! 没有找到相关商品</p>
        </div>
        <?php }?>
      </div>
    </div>
    <div class="ncs-main-container">
      <div class="title"><span><a href="<?php echo url('shop/Showstore/goods_all', array('store_id' => I('param.store_id')));?>" class="more">更多</a></span>
        <h4>新品</h4>
      </div>
      <div class="content ncs-goods-list">
        <?php if(!empty($new_goods_list) && is_array($new_goods_list)){?>
        <ul>
          <?php foreach($new_goods_list as $value){?>
          <li>
            <dl>
              <dt><a href="<?php echo url('shop/Goods/index', array('goods_id'=>$value['goods_id']));?>" class="goods-thumb" target="_blank">
              	<img src="__UPLOAD_PATH__/shop/common/loading.gif" rel="lazy" data-url="<?php echo thumb($value, 240)?>" alt="<?php echo $value['goods_name'];?>"/></a>
                <ul class="goods-thumb-scroll-show">
                <?php if (is_array($value['image'])) { array_splice($value['image'], 5); ?>
                  <?php $i=0;foreach ($value['image'] as $val) { $i++;?>
                  <li<?php if($i==1) {?> class="selected"<?php }?>><a href="javascript:void(0);">
                  	<img src="__UPLOAD_PATH__/shop/common/loading.gif" rel="lazy" data-url="<?php echo thumb($val, 60);?>"/></a></li>
                  <?php }?>
                <?php } else {?>
                  <li class="selected"><a href="javascript:void(0)">
                  	<img src="__UPLOAD_PATH__/shop/common/loading.gif" rel="lazy" data-url="<?php echo thumb($value, 60);?>"></a></li>
                <?php }?>
                </ul>
              </dt>
              <dd class="goods-name"><a href="<?php echo url('shop/Goods/index', array('goods_id'=>$value['goods_id']));?>" title="<?php echo $value['goods_name'];?>" target="_blank"><?php echo $value['goods_name'];?></a></dd>
              <dd class="goods-info"><span class="price"><i>￥</i> <?php echo ncPriceFormat($value['goods_promotion_price']);?> </span> <span class="goods-sold">已售：<strong><?php echo $value['goods_salenum'];?></strong> 件</span></dd>
              <?php if (sysconf('groupbuy_allow') && $value['goods_promotion_type'] == 1) {?>
              <dd class="goods-promotion"><span>抢购商品</span></dd>
              <?php } elseif (sysconf('promotion_allow') && $value['goods_promotion_type'] == 2)  {?>
              <dd class="goods-promotion"><span>限时折扣</span></dd>
              <?php }?>
              </dl>
          </li>
          <?php }?>
        </ul>
        <?php }else{?>
        <div class="nothing">
          <p>很抱歉! 没有找到相关商品</p>
        </div>
        <?php }?>
      </div>
    </div>
  </div>
  <div class="ncs-sidebar">
  	{include file="shop/showstore/common/store_left" /}
  </div>
</div>

<!-- 引入幻灯片JS --> 
<script type="text/javascript" src="__SITE_RESOURCE__/js/jquery.flexslider-min.js"></script> 
<!-- 绑定幻灯片事件 --> 
<script type="text/javascript">
	$(window).load(function() {
		$('.flexslider').flexslider();


	    // 图片切换效果
	    $('.goods-thumb-scroll-show').find('a').mouseover(function(){
	        $(this).parents('li:first').addClass('selected').siblings().removeClass('selected');
	        var _src = $(this).find('img').attr('src');
	        _src = _src.replace('_60.', '_240.');
	        _src = _src.replace('-60', '-240');
	        $(this).parents('dt').find('.goods-thumb').find('img').attr('src', _src);
	    });
	});
</script>
<?php } ?>
	
{/block}
